<%@ page language="java" contentType="text/html; charset=UTF-8"  pageEncoding="UTF-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<%@page import="org.durcframework.core.UserContext"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>MIO后台管理系统</title>
<link rel="icon" href="${pageContext.request.contextPath }/assets/jquery-easyui-1.4.3/themes/default/images/mioIcon.png" type="image/x-icon" />
<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath }/assets/css/style.css" />
<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath }/assets/jquery-easyui-1.4.3/themes/default/easyui.css" />
<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath }/assets/jquery-easyui-1.4.3/themes/icon.css" />
<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath }/assets/css/easyui.icon.css" />
<script type="text/javascript" src="${pageContext.request.contextPath }/assets/jquery-easyui-1.4.3/jquery.min.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath }/assets/jquery-easyui-1.4.3/jquery.easyui.min.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath }/assets/jquery-easyui-1.4.3/locale/easyui-lang-zh_CN.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath }/assets/jquery.js/jquery.json.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath }/assets/jquery.js/jquery.fw.ext.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath }/assets/easyui.js/easyui.ext.js"></script>
<!-- <script type="text/javascript" src="${pageContext.request.contextPath }/assets/js/menu.js"></script> -->
<script type="text/javascript" src="${pageContext.request.contextPath }/assets/js/message.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath }/assets/js/MD5.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath }/assets/js/moment.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath }/assets/js/zh-cn.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath }/assets/js/menu.js"></script>
<script>
	//获取当前时间
	function tick(){
		$("#year").html('今天是'+moment().format('YYYY年MM月DD日'));
		$("#week").html(moment().format('dddd'));
		$("#time").html(moment().format('H:mm'));
		window.setTimeout("tick()", 1000);
	}
	tick();	
	
	logoutFun = function() {
		$.ajax({
			type : "POST",
			url : '${pageContext.request.contextPath}/logout.do',
			dataType : 'json',
			success : function(result) {
				if (result.success) {
					location.href = 'backLogin.jsp';
				}
			},
			error : function() {
				location.href = 'backLogin.jsp';
			}
		});
	}
	
	updatePswd = function() {

		$("#dd").dialog('open');
		
	}
	
	submit = function (){
		var oldpassword = $.trim($('#oldpassword').val());
		var newpassword = $.trim($('#newpassword').val());
		var cnewpassword = $.trim($('#cnewpassword').val());
		var userName =
			"";
		var Id =
			"";

		if(cnewpassword!==newpassword){
			 $.messager.show({
                 title : message.title.normal,
                 msg : message.pwd_fail,
                 timeout : message.timeout,
                 showType : message.showType
             });
			//alert("新密码不一致，请重新设置");
		}
		else
		{
			var pwd = {id:Id,userName: userName, userPwd: faultylabs.MD5(oldpassword), newpassword: faultylabs.MD5(newpassword)}
			$.ajax({
				type : "POST",
				data: pwd,
				url : ctx + 'updatePswd.do',
				dataType : 'json',
				success : function(result) {
					alert(result);
				},
				error : function() {
					alert("信息传递有误");
				}
			});
			$("#dd").dialog('close');
		}
		
	}
</script>
<style>
.header_self{
	height:80px;
	background:-ms-linear-gradient(left,rgb(96, 182, 48), rgb(1, 168, 58))!important;
	background:-webkit-linear-gradient(left,rgb(96, 182, 48), rgb(1, 168, 58))!important;
	background:-moz-linear-gradient(left,rgb(96, 182, 48), rgb(1, 168, 58))!important;	
}
.panel-header{ 
	background:-ms-linear-gradient(top,rgb(130, 218, 81),rgb(21, 171, 57))!important;
	background:-webkit-linear-gradient(top,rgb(130, 218, 81),rgb(21, 171, 57))!important;
	background:-moz-linear-gradient(top,rgb(130, 218, 81),rgb(21, 171, 57))!important;
	height:36px;
	padding:0;
	border:0px solid red;
}
.panel-title {
    font-size: 14px;
    font-weight: bold;
    color: hsl(0, 0%, 100%);
    height: 36px;
    line-height: 36px;
    text-align: center;
}
.tabs li a.tabs-inner {
margin-top:6px ;
border-color:#E6E6E6;
}
.tabs li.tabs-selected a.tabs-inner{
border-color:#E6E6E6;
}
.tabs-header, .tabs-scroller-left, .tabs-scroller-right, .tabs-tool, .tabs, .tabs-panels, .tabs li a.tabs-inner, .tabs li.tabs-selected a.tabs-inner, .tabs-header-bottom .tabs li.tabs-selected a.tabs-inner, .tabs-header-left .tabs li.tabs-selected a.tabs-inner, .tabs-header-right .tabs li.tabs-selected a.tabs-inner {
    border-color: hsl(0, 0%, 89%);
}
</style>
</head>
<body class="easyui-layout" data-options="fit:true,border:false">

	<div class="north north_self" data-options="region:'north',border:false" style="min-width:960px" >
		<div class="header header_self" >
			<div class="logo" style="margin-left:20px">
			<div style="float:left;font-weight:bold;line-height:56px;">MIO后台管理系统</div>
			<div style="float:left; margin-left:100px; margin-top:22px;font-size:12px"class="self_time"><span id="year"></span> <span id="week"></span> <span id="time"></span></div>
			</div>
			<div  style="padding-top:30px;font-size:12px;"class="logout">
			欢迎您，
				| <a  style="font-size:12px;"href="javascript:void(0)" onclick="updatePswd(); return false;">修改密码</a>
				| <a style="font-size:12px;" href="javascript:void(0)" onclick="logoutFun()">退出系统&nbsp;&nbsp;</a>
			</div>
			<div style="float:right;padding-top:7px;" class="index_headicon"><img alt="" src="${pageContext.request.contextPath }/assets/jquery-easyui-1.4.3/themes/default/images/loginImg.png"/></div>
		</div>
	</div>
	<div data-options="region:'center'">
		<div id="tabs" class="easyui-tabs" data-options="fit:true,border:false,closable:false">
			<div id="indexContent" title="首页" style="width:80%; margin:0px auto;">
				<div id="userStatistics" style="width:30%; margin-top:50px; float:left; margin-left:3%;"></div>
				<div id="deviceStatistics" style="width:60%; margin-top:50px; float:left; margin-left:6%;"></div>
				<div id="articleStatistics" style="width:30%; margin-top:50px; float:left; margin-left:3%;"></div>
				<div id="subSysClassStatistics" style="width:30%; margin-top:50px; float:left; margin-left:3%;"></div>
				<div id="parentsCircleStatistics" style="width:30%; margin-top:50px; float:left; margin-left:3%;"></div>
			</div>
		</div>
	</div>
	<div class="west" data-options="region:'west',split:true,title:'系统菜单',collapsible:false" style="background-color:rgb(249, 249, 249); width:165px;">
	<ul id="tree">

	</ul>
	</div>
	<div class="south" data-options="region:'south'" style="background-color:rgb(249, 249, 249)">
		<div class="copyright">Copyright © 睿眼通（上海）信息科技有限公司 版权所有</div>
	</div>

	<div id="tabsMenu" class="easyui-menu" style="width: 120px;">
		<div name="close">关闭</div>
		<div name="Other">关闭其他</div>
		<div name="All">关闭所有</div>
	</div>
	
    <div id="dd" class="easyui-dialog" closed = "true" style="padding:5px;width:400px;height:200px;"
			title="修改密码" 
			toolbar="#dlg-toolbar" buttons="#dlg-buttons">
			
		<div style="text-align:center; padding:6px 0px;" >请输入旧密码：<input id = "oldpassword" value="admin" type="password"></input></div>
		<div style="text-align:center;">请输入新密码：<input id = "newpassword" value="admin" type="password"></input></div>
		<div style="text-align:center; padding:6px 0px;">请确认新密码：<input id = "cnewpassword" value="admin" type="password"></input></div>	
		<div id="dlg-buttons">
			<a href="#" class="easyui-linkbutton" iconCls="icon-ok" onclick="submit()">确认</a>
			<a href="#" class="easyui-linkbutton" iconCls="icon-cancel" onclick="javascript:$('#dd').dialog('close')">取消</a>
		</div>	
	</div>
	<script>
		$(function(){

		});

	</script>
</body>
</html>